home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Utilities / BareED / rexx / Info.rx < prev    next >
Text File  |  2000-02-05  |  2KB  |  90 lines

  1. /* Get internal things of BareED - NOTE:
  2.    The region size differs from the TextBuffer size by 4 bytes.
  3.    When you a encounter a value '4' it represents this fact!
  4. */
  5.  
  6. BAREED_HOST = GetClip('BAREED')
  7.  
  8. IF BAREED_HOST = '' THEN DO
  9.     CALL SetClip('BAREED')    /* Remove from ClipNode */
  10.     EXIT 5
  11.     END
  12.  
  13. ADDRESS VALUE BAREED_HOST
  14.  
  15. CALL SetClip('BAREED')        /* Remove from ClipNode */
  16.  
  17. /* ---------------------- MAIN --------------------- */
  18.  
  19. 'set error off'            /* BareED, return errors! Default.
  20.                    Since ERROR collides with a ARexx keyword we
  21.                    have to set ERROR within single quotes */
  22.  
  23. 'set echo off'            /* BareED, don't display given ARexx string and parsing results. Default.
  24.                    Since ECHO collides with a ARexx keyword we
  25.                    have to set ECHO within single quotes */
  26.  
  27. options results            /* Tell BareED to return things */
  28.  
  29.  
  30. get archivename            /* as usually, macro commands in lower case */
  31. AName = result
  32. if AName = "" then
  33.     AName = "<-unset->"
  34.  
  35. get filename
  36. FName = result
  37. if FName = "" then
  38.     FName = "<-unset->"
  39.  
  40. get font
  41. FoName = result
  42.  
  43. get tab size
  44. TSize = result
  45.  
  46. LF = '0a'x
  47.  
  48. string = "Informations for archive »"AName"«."LF LF
  49. string = string || "Archive will be saved to »"FName"«"LF
  50. string = string || "using font »"FoName"« and a tab size of "TSize"."LF LF
  51.  
  52.  
  53. 'get region'            /* Supplied in lower case */
  54. StPtr = result
  55.  
  56. 'GET REGION SIZE'        /* Supplied in upper case */
  57. StSize = result
  58.  
  59. 'geT AMOUNT chArs'        /* Supplied in mixed form */
  60. Used = result
  61.  
  62. /* Of course you can also enter each commandline without single quotes - when no BareED
  63.    supported keyword collides with ARexx ones!
  64. */
  65.  
  66.  
  67. string = string || "Storage starts at 0x"D2X(StPtr)", size" StSize "bytes ("StSize / 1024 "Kbytes)."LF
  68.  
  69. numeric digits 3        /* Output of computed values limited to 3 digits from now on */
  70.  
  71. string = string || "Storage filled with" Used "characters and therewith to" ABS((Used + 4) * 100 / StSize)"%%."LF
  72.  
  73. numeric digits 9        /* Reset to default */
  74.  
  75. string = string || "Free bytes in storage:" StSize - Used - 4 "bytes."LF
  76.  
  77. get archivestart
  78. AStart = result
  79.  
  80. get archiveend
  81. AEnd = result
  82.  
  83. get amount lines
  84. ALines = result
  85.  
  86. string = string || LF || "Archive starts at memory location 0x"D2X(AStart) "and"LF
  87. string = string || "ends at 0x"D2X(AEnd) "where the archive contains" ALines "lines."
  88.  
  89. Tell string
  90.